package pack1021.interface2;

public class School {

    private String name;
    private Print print;

    public School(String name) {
        this.name = name;
    }

    public School(String name, Print print) {
        this.name = name;
        this.print = print;
    }

    public String detail() {
        return "我是" + name;
    }

    public void print(Teacher teacher){
        String detail = teacher.detail();
        print.print(detail);
    }

    public void print(School school){
        String detail = school.detail();
        print.print(detail);
    }

    public void print(Student student){
        String detail = student.detail();
        print.print(detail);
    }
}